---
page_title: "cloudflare_account_roles Data Source - Cloudflare"
subcategory: ""
description: |-
  Use this data source to lookup Account Roles https://api.cloudflare.com/#account-roles-properties.
---

# cloudflare_account_roles (Data Source)

Use this data source to lookup [Account Roles](https://api.cloudflare.com/#account-roles-properties).

## Example Usage

```terraform
data "cloudflare_account_roles" "account_roles" {
    account_id = "f037e56e89293a057740de681ac9abbe"
}

locals {
  roles_by_name = {
    for role in data.cloudflare_account_roles.account_roles.roles :
      role.name => role
  }
}

resource "cloudflare_account_member" "member" {
  ...
  role_ids = [
    local.roles_by_name["Administrator"].id
  ]
}
```
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `account_id` (String) The account identifier to target for the resource.

### Read-Only

- `id` (String) The ID of this resource.
- `roles` (List of Object) A list of roles object. (see [below for nested schema](#nestedatt--roles))

<a id="nestedatt--roles"></a>
### Nested Schema for `roles`

Read-Only:

- `description` (String)
- `id` (String)
- `name` (String)


